CREATE EXTERNAL TABLE jms_dm.dm_cainiao_miaomiao_query_detail_v2_hi(
       rec_date               string comment '揽收日期'
      ,bill_code              string comment '运单号'
      ,logistics_status_code  string comment '物流查询结果状态编码'
      ,logistics_status       string comment '物流查询结果状态'
      ,abnormal_reason_type   string comment '物流异常原因编码'
      ,abnormal_reason        string comment '异常原因'
      ,rec_time               string comment '揽收时间'
      ,plan_recover_time      string comment '预计解决时间 yyyy-mm-dd hh:mm:ss'
      ,phone_no               string comment '联系方式'
      ,latest_network_type    string comment '最新扫描网点类型'
      ,second_level_type_code   string comment '问题件二级类型编码'
      ,second_level_type_name   string comment '问题件二级类型名称'
      ,latest_scan_date      string comment '最新扫描时间'
      ,latest_scan_name      string comment '最新扫描网点'
      ,input_date            string comment '订单录入时间'
      ,update_time           string comment '更新时间yyyy-mm-dd hh:mm:ss'
      ,is_timeout            string comment '是否超时'
      ,logic_miss_standard   string comment '断更标准S'
      ,sender_province_id     string comment '寄件省份id'
      ,send_city_id           string comment '寄件城市id'
      ,sender_province_name   string comment '寄件省份名称'
      ,send_city_name         string comment '寄件城市名称'
      ,receiver_province_name string comment '收件省份名称'
      ,receiver_city_name     string comment '收件城市名称'
      ,receiver_province_id   string comment '收件省份id'
      ,receiver_city_id       string comment '收件城市id'
      ,unique_key             string comment '主键'
      ,flag                   string comment '标识'
)
COMMENT '菜鸟妙妙查明细表'
PARTITIONED BY (dt string COMMENT '日期')
STORED AS PARQUET
LOCATION '/dw/hive/jms_dm.db/external/dm_cainiao_miaomiao_query_detail_v2_hi'
TBLPROPERTIES (
    'discover.partitions' = 'false',
    'parquet.column.index.access' = 'true'
);

